package com.knowledge.business.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
        import com.knowledge.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.knowledge.business.mapper.TQuestionMapper;
import com.knowledge.business.domain.TQuestion;
import com.knowledge.business.service.ITQuestionService;

/**
 * 常见问题Service业务层处理
 *
 * @author zhaoyk
 * @date 2025-09-17
 */
@Service
public class TQuestionServiceImpl extends ServiceImpl<TQuestionMapper,TQuestion>  implements ITQuestionService
{
    @Autowired
    private TQuestionMapper tQuestionMapper;

    /**
     * 查询常见问题
     *
     * @param id 常见问题主键
     * @return 常见问题
     */
    @Override
    public TQuestion selectTQuestionById(String id)
    {
        return tQuestionMapper.selectTQuestionById(id);
    }

    /**
     * 查询常见问题列表
     *
     * @param tQuestion 常见问题
     * @return 常见问题
     */
    @Override
    public List<TQuestion> selectTQuestionList(TQuestion tQuestion)
    {
        return tQuestionMapper.selectTQuestionList(tQuestion);
    }

    /**
     * 新增常见问题
     *
     * @param tQuestion 常见问题
     * @return 结果
     */
    @Override
    public int insertTQuestion(TQuestion tQuestion)
    {
                tQuestion.setCreateTime(DateUtils.getNowDate());
            return tQuestionMapper.insertTQuestion(tQuestion);
    }

    /**
     * 修改常见问题
     *
     * @param tQuestion 常见问题
     * @return 结果
     */
    @Override
    public int updateTQuestion(TQuestion tQuestion)
    {
                tQuestion.setUpdateTime(DateUtils.getNowDate());
        return tQuestionMapper.updateTQuestion(tQuestion);
    }

    /**
     * 批量删除常见问题
     *
     * @param ids 需要删除的常见问题主键
     * @return 结果
     */
    @Override
    public int deleteTQuestionByIds(String[] ids)
    {
        return tQuestionMapper.deleteTQuestionByIds(ids);
    }

    /**
     * 删除常见问题信息
     *
     * @param id 常见问题主键
     * @return 结果
     */
    @Override
    public int deleteTQuestionById(String id)
    {
        return tQuestionMapper.deleteTQuestionById(id);
    }
}
